#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time,threading

CURRENT_THREAD__NAME_ = ('Thread %s ended' % threading.current_thread().name)


def loop():
    print('thread %s is runing---' % threading.current_thread().name)
    n = 0
    while n < 5:
        n = n + 1
        print('thread %s >>> %s' % (threading.current_thread().name,n))
        time.sleep(1)
    print('thread %s ended.' % threading.current_thread().name)
print('thread %s is runing---' % threading.current_thread().name)
t = threading.Thread(target = loop, name = 'LoopThread')
t.start()
t.join()
print CURRENT_THREAD__NAME_
